package com.ruoyi.infoSiteService.controller;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.system.service.ISysDictDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;


/*
* 字典相关网页接口
* */
@RestController
@RequestMapping("/site/dict")
public class InfoSiteDictController {

    @Autowired
    private ISysDictDataService dictDataService;


    //查左测分类
    @GetMapping("/college")
    public AjaxResult selectCollege(){
        //查专业
        SysDictData sysDictData = new SysDictData();
        sysDictData.setDictType("info_degree");
        List<SysDictData> InfoDegrees = dictDataService.selectDictDataList(sysDictData);
        HashMap<String, Object> map = new HashMap<>();
        map.put("InfoDegree",InfoDegrees);
        //info_collegial_label
        sysDictData.setDictType("info_collegial_label");
        List<SysDictData> infoCollegialLabels = dictDataService.selectDictDataList(sysDictData);
        map.put("infoCollegialLabel",infoCollegialLabels);
        //info_collegial_nature
        sysDictData.setDictType("info_collegial_nature");
        List<SysDictData> infoCollegialNatures = dictDataService.selectDictDataList(sysDictData);
        map.put("infoCollegialNatures",infoCollegialNatures);
        //info_collegial_type
        sysDictData.setDictType("info_collegial_type");
        List<SysDictData> infoCollegialTypes = dictDataService.selectDictDataList(sysDictData);
        map.put("infoCollegialType",infoCollegialTypes);
        return AjaxResult.success(map);
    }

}
